1. Technology Field
The invention relates to a data backup method and particularly to a data backup method for backing up data temporarily stored in a cache memory of a flash memory storage device, a flash memory controller, and a flash memory storage system using the same.
2. Description of Related Art
The growth of digital cameras, mobile phones, and MP3 players has been rapid in recent years. Consequently, demands of consumers for storage media of digital contents have increased tremendously. Since flash memory has a characteristics of non-volatile data, energy saving, compact size, and no mechanical construction, the flash memory is suitable for users to carry around as the storage media for transferring and exchanging the digital files. Solid State Drive (SSD) is an example of utilizing the flash memory as the storage media, and has been widely applied in the computer host as a main hard disk.
Generally speaking, in designs of a flash memory storage system, flash memory physical units of the flash memory storage system are grouped into a plurality of physical units and the physical units are further grouped into a data area and a spare area. The physical units in the data area are used for storing valid data written by a write command, and the physical units in the spare area are used for replacing the physical units in the data area during the execution of the write command. More specifically, when the flash memory storage system receives the write command from the host to update data in a physical unit in the data area, the flash memory storage system first gets one physical unit from the spare area, and then writes valid old data in the physical unit, which is to be updated, in the data area together and the new data to be written into a physical unit gotten from the spare area. Further, the physical unit written with the new data is associated to the data area, and the original physical unit, which is to be updated, in the data area is erased and associated to the spare area. In order for the host to properly access the physical units that store data in an alternate manner, the flash memory storage system provides logical units to the host. That is, the flash memory storage system records and updates a mapping relationship between the logical units and the physical units in the data area with the logical address-physical address mapping table to reflect an alternation of the physical units. Therefore, the host is only required to perform writing operation based on the logical units provided and the flash memory storage system would read data from or write data into the physical units mapped according to the logical address-physical address mapping table.
However, compared with operations of the computer host (e.g., data transmission), time required by writing data for a flash memory storage device to perform the above-described the alternation of the physical units is relatively longer. Therefore, in order to enhance efficiency of the flash memory storage device, a cache memory is generally configured in the flash memory storage device for shortening time required for completing related commands.
For example, under a case where the flash memory storage device takes relatively more time to complete the write commands from the computer host system, when the computer host system gives the write command the flash memory storage system, the flash memory storage system may temporarily stores the data, which is to be written, into the cache memory, and replies the computer host system that the write command is completed. Thereafter, the flash memory storage device writes the data into the flash memory therein during the non-busy period.
However, in a framework of utilizing the flash memory storage device of the cache memory, if the cache memory temporarily stores data of a relatively large amount of data, or the data stored temporarily is required to be written into a plurality of different logical units, when the computer host system gives a command of flushing the cache memory to the flash memory storage device, the flash memory storage device takes a very long time to write the data temporarily stored in the cache memory into the physical units, thereby causing a severe delay on operations of the computer host system.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.